/*  1:   */ package com.htxx.security.cipher;
/*  2:   */ 
/*  3:   */ public abstract class Cipher
/*  4:   */   extends CryptoUtils
/*  5:   */ {
/*  6:   */   public int keySize;
/*  7:   */   
/*  8:   */   public Cipher(int keySize)
/*  9:   */   {
/* 10:11 */     this.keySize = keySize;
/* 11:   */   }
/* 12:   */   
/* 13:   */   public int keySize()
/* 14:   */   {
/* 15:16 */     return this.keySize;
/* 16:   */   }
/* 17:   */   
/* 18:   */   public abstract void setKey(byte[] paramArrayOfByte);
/* 19:   */   
/* 20:   */   public void setKey(String keyStr)
/* 21:   */   {
/* 22:23 */     setKey(makeKey(keyStr));
/* 23:   */   }
/* 24:   */   
/* 25:   */   public byte[] makeKey(String keyStr)
/* 26:   */   {
/* 27:   */     byte[] key;
/* 28:   */     byte[] key;
/* 29:31 */     if (this.keySize == 0) {
/* 30:32 */       key = new byte[keyStr.length()];
/* 31:   */     } else {
/* 32:34 */       key = new byte[this.keySize];
/* 33:   */     }
/* 34:36 */     for (int j = 0; j < key.length; j++) {
/* 35:37 */       key[j] = 0;
/* 36:   */     }
/* 37:39 */     int i = 0;
/* 38:39 */     for (j = 0; i < keyStr.length(); j = (j + 1) % key.length)
/* 39:   */     {
/* 40:40 */       int tmp56_54 = j; byte[] tmp56_53 = key;tmp56_53[tmp56_54] = ((byte)(tmp56_53[tmp56_54] ^ (byte)keyStr.charAt(i)));i++;
/* 41:   */     }
/* 42:42 */     return key;
/* 43:   */   }
/* 44:   */ }


/* Location:           D:\htjs\document\wsrz\WsrzEjbInf\
 * Qualified Name:     com.htxx.security.cipher.Cipher
 * JD-Core Version:    0.7.0.1
 */